<?php
//------------------------
// 分类下品牌模型
//-------------------------
namespace app\common\model;

use think\Model;
use think\Db;

class GoodsCateBrand extends Model{

    // 设置品牌
    public function setBrand($cateId,$brandArray){
    	$this->where('cate_id',$cateId)->delete();

    	foreach ($brandArray as $v) {
    		$setData = array();
    		$setData['cate_id']  = $cateId;
    		$setData['brand_id'] = $v;
    		$this->isUpdate(false)->save($setData);
    	}
    }
}